package com.jic.member.controller.manage;

import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.member.api.rest.MemberInformationApi;
import com.jic.member.request.MeinformationRequest;
import com.jic.member.response.MeinformationResponse;
import com.jic.member.service.MeinformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@ResponseBody
@RequestMapping("/information")
@Api(value = "APi-会员消息",tags = "APi-会员消息")
public class ApiMemberInformationController implements MemberInformationApi {

    @Autowired
    MeinformationService meinformationService;

    @ApiOperation(value = "获取会员消息列表")
    @Override
    public RestResult<PageResult<MeinformationResponse>> getMemberInfoList(MeinformationRequest meinformationRequest) {
        return meinformationService.getMemberInfoList(meinformationRequest);
    }

    @ApiOperation(value = "删除会员消息")
    @Override
    public RestResult<String> deleteMemberInformation(MeinformationRequest meinformationRequest) {
        return meinformationService.deleteMemberInfo(meinformationRequest);
    }

    @ApiOperation(value = "插入会员消息")
    @ResponseBody
    @Override
    public RestResult<String> insertMemberInformation(MeinformationRequest meinformationRequest) {
        return meinformationService.insertMemberInformation(meinformationRequest);
    }

    @ApiOperation(value = "更新会员消息")
    @ResponseBody
    @Override
    public RestResult<String> updateMemberInformation(MeinformationRequest meinformationRequest) {
        return meinformationService.updateMemberInformation(meinformationRequest);
    }
}
